home *** CD-ROM | disk | FTP | other *** search
- property ichCheckBox, iCurrentValue
-
- on birth me
- return me
- end
-
- on mInit me, chCheckBox, defaultValue
- set ichCheckBox to chCheckBox
- puppetSprite(ichCheckBox, 1)
- if voidp(defaultValue) then
- set iCurrentValue to 1
- else
- set iCurrentValue to defaultValue
- end if
- mDraw(me)
- end
-
- on mDraw me
- global gCastNumCheckBoxOn, gCastNumCheckBoxOff
- if iCurrentValue then
- set the castNum of sprite ichCheckBox to gCastNumCheckBoxOn
- else
- set the castNum of sprite ichCheckBox to gCastNumCheckBoxOff
- end if
- updateStage()
- end
-
- on mHit me
- set iCurrentValue to not iCurrentValue
- mDraw(me)
- end
-
- on mGetValue me
- return iCurrentValue
- end
-
- on mSetValue me, theNewValue
- if (theNewValue <> 1) and (theNewValue <> 0) then
- alert("Bad value passed to mSetValue of CheckBox:" && theNewValue)
- return
- end if
- set iCurrentValue to theNewValue
- mDraw(me)
- end
-
- on mCleanUp me
- puppetSprite(ichCheckBox, 0)
- end
-